package com.lucene.model;

import java.sql.Timestamp;
import java.util.Arrays;

/**
 * Created by zhangzhen on 25/10/2017.
 */
public class Image extends Prototype{

    private Integer pid;//问题id
    private String src;//图片路径
    private String title;//图片名称
    private String suffix;//图片格式
    private byte[] body;//二进制数据

    public Image() {
    }

    public Image(String src) {
        this.src = src;
    }

    public Image(Integer pid, String src, String title, String suffix) {
        this.pid = pid;
        this.src = src;
        this.title = title;
        this.suffix = suffix;
    }

    public Image(Integer pid, String src, String title, String suffix, Timestamp creatTime,Timestamp updateTime) {
        this.pid = pid;
        this.src = src;
        this.title = title;
        this.suffix = suffix;
        setCreate_time(creatTime);
        setUpdate_time(updateTime);
    }

    public Integer getPid() {
        return pid;
    }

    public void setPid(Integer pid) {
        this.pid = pid;
    }

    public String getSrc() {
        return src;
    }

    public void setSrc(String src) {
        this.src = src;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getSuffix() {
        return suffix;
    }

    public void setSuffix(String suffix) {
        this.suffix = suffix;
    }

    public byte[] getBody() {
        return body;
    }

    public void setBody(byte[] body) {
        this.body = body;
    }

    @Override
    public String toString() {
        return "Image{" +
                "pid=" + pid +
                ", src='" + src + '\'' +
                ", title='" + title + '\'' +
                ", suffix='" + suffix + '\'' +
                '}';
    }
}
